﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Diagnostic : System.Web.UI.Page
{
    protected string sTitle = string.Empty;
    protected ArticleItem article;
    protected CategoryItem catItem;

    protected void Page_Load(object sender, EventArgs e)
    {
        GetParameters();

        HtmlMeta meta = new HtmlMeta();
        meta.Name = "keywords";
        meta.Content = PageHeaderData.GetPageKeywordsByType(NewsType.MedicalTourism);
        this.Header.Controls.Add(meta);
        //sTitle = catItem.cTitle;
        if (catItem.catId != 18)
        {
            divContact.Visible = false;
            string sTitle = string.Format("<img src=\"images/bullet4.gif\" /><a href='Diag_GoodBad.aspx'>Организация диагностики и лечения в выбранном Вами медицинском центре</a>");
            divTitleLink.InnerHtml += sTitle;
        }
        else
        {
            btnContact.Visible = false;
            //Diagnostic
            DataTable DTDiag = Dal.ExecuteDBsp("usp_GetDiagnostic");
            if (DTDiag != null)
            {
                string sOutput = string.Empty;
                for (int iCount = 1; iCount < DTDiag.Rows.Count; iCount++)
                {
                    DataRow DR = DTDiag.Rows[iCount];
                    sOutput += string.Format("<li>{0}</li><ul class=\"centerbut\">" +
                                            "<li><a href='{1}.aspx'>Более подробно об этом здесь </a></li></ul>",
                                            DR["title"], DR["cpageName"]);
                }
                ulDiags.InnerHtml += sOutput;
            }
        }

        Page.Title = article.BrowserTitle;
        // Hightlight main menu
        ucHeader1.index = "4";
    }

    private void GetParameters()
    {
        string sFilename = Request.Params["a"];
        catItem= Category.ItemByPageName(sFilename);
        article = Articles.GetArticleCatID(catItem.catId);
    }
}
